var a = {
    value: 0,
    valueOf: function() {
        this.value++
        return this.value
    }
}

// console.log(a.valueOf());

console.log(a == 1 && a==2); // true


// a === a-1
// let b = Infinity
// console.log(b === b - 1);




// a == a - 1
var b = {
    value:0,
    valueOf: function() {
        this.value--
        return this.value
    }
}

console.log( b == b - 1);